Developers may program an application to render a control to a graphical user interface (GUI) thereof, wherein the control includes several elements, each of which is used to display different data items obtained from a data source at runtime. For example, each element may comprise an instance (or replica) of a control template and may be used as a container for displaying content and/or inner controls obtained from a corresponding record of a data source at runtime.
If the size of the data items that will be obtained from the data source cannot be determined during application development, then the developer faces a problem. If the control template has a fixed size, then it is possible that data items will overflow the control template replica into which they are rendered at runtime. To deal with this issue, the developer may program the application to truncate the data items within the control template replica (e.g., truncate text after a fixed number of characters) or enable scrolling (e.g., providing an HTML viewer control with scrolling). The former approach is disadvantageous because it does not show all the data and the latter approach is disadvantageous because it requires showing nested scrollbars and user interaction therewith to view all the data.
The developer may also try to address this problem by programming the application to show the data that does not fit within the control template replica on a different screen of the GUI. However, this approach is not user-friendly as it requires the user to navigate back and forth between GUI screens to see the data.
The developer may also try to estimate the size of the data and set the size of the control template to accommodate a maximum possible size. This has the disadvantage of showing unneeded gaps when the data items do not utilize the allotted space. Also, there is no guarantee that the estimated maximum possible size will handle all cases.